<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/template-web.js"></script>
    <script src="./js/zepto/zepto.min.js"></script>
</head>

<body>
    <div>
        <ul class="ulbox">
            <!-- <li>
                <span>id</span>
                <span>name</span>

            </li> --> 
        </ul>
    </div>

    <script type="html/text" id='tmp'>
        {{each rows value index}}
            <li>
                        <span>{{value.id}}</span>
                        <span>{{value.name}}</span>

             </li>
    
        {{/each}}
    </script>

    <script>
        var obj = {
            name: 'zhangsan',
            rows: [{ name: 'zhangsan', id: 1 }, { name: 'zhangsan2', id: 2 }, { name: 'zhangsan3', id: 3 }]
        }

        var htmls = template('tmp', obj)
        console.log(htmls);
        $('.ulbox').html(htmls)

   


    </script>
</body>

</html>